/*
 * @Author       : mengqingxin
 * @Date         : 2020-12-06 12:54:38
 * @LastEditors  : mengqingxin
 * @LastEditTime : 2020-12-06 16:54:26
 */
import request from '../utils/request';
const baseUrl = getApp().globalData.baseUrl

// 查询产品大类
export function queryRootCategory(data) {
  return request({
    url: `${baseUrl}/electronic/queryRootCategory`,
    method: 'post',
    data
  })
}

// 查询二级分类
export function queryChildrenCategory(data) {
  return request({
    url: `${baseUrl}/electronic/queryChildrenCategory`,
    method: 'post',
    data
  })
}

// 查询分类产品
export function queryProBaseByCategoryId(data) {
  return request({
    url: `${baseUrl}/erp/pro/base/queryAll`,
    method: 'post',
    data
  })
}


// 验证SN
export function validSn(data) {
  return request({
    url: `${baseUrl}/aftersale/order/item/validSn`,
    method: 'post',
    data
  })
}


// 发布寄件工单
export function save(data) {
  return request({
    url: `${baseUrl}/aftersale/order/base/save`,
    method: 'post',
    data
  })
}


// 查询是否是系统中的产品信息
export function queryGoods(data) {
  return request({
    url: `${baseUrl}/electronic/getProGoodsByCode`,
    method: 'post',
    data
  })
}


//查询认领工单
export function queryOrderByCode(data) {
    return request({
        url: `${baseUrl}/electronic/queryOrderByCode`,
        method: 'post',
        data
    })
}

//查询售后订单详情
export function getOrder(data) {
  return request({
    url: `${baseUrl}/aftersale/order/base/get?id=${data.id}`,
    method: 'post',
    data
  })
}


//查询售后订单项orderItem详情
export function getOrderItem(data) {
  return request({
    url: `${baseUrl}/aftersale/order/item/get?id=${data.id}`,
    method: 'post',
    data
  })
}


//保存维修工单 ，暂存
export function saveOrderItem(data) {
  return request({
    url: `${baseUrl}/aftersale/order/item/save`,
    method: 'post',
    data
  })
}

// 根据联系手机查询质保卡
export function warrantyCardByPhone(data) {
  return request({
    url: `${baseUrl}/erp/warranty/card/queryAll`,
    method: 'post',
    data
  })
}

// 根据sn查询 质保卡 联系电话产品信息
export function queryAllWarrantyBySn(data) {
  return request({
    url: `${baseUrl}/erp/warranty/card/queryAllWarrantyBySn`,
    method: 'post',
    data
  })
}
